<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html class="x-admin-sm">

<head>
<meta charset="UTF-8">
<title>欢迎页面-X-admin2.2</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
<link rel="stylesheet" href="./css/font.css">
<link rel="stylesheet" href="./css/xadmin.css">
<script src="./lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="./js/xadmin.js"></script>
</head>

<body>

	<div class="layui-fluid">
		<div class="layui-row layui-col-space15">
			<div class="layui-col-md12">
				<div class="layui-card">

					<div class="layui-card-body ">
						<table class="layui-table layui-form" id="demo">

						</table>
					</div>
				</div>
			</div>
		</div>
	</div>

</body>

<script>
     //读取orderid信息
    function fungetItem(){
    	let orderid = localStorage.getItem("orderid");
    	console.log("fungetItem: "+orderid);
    }
    fungetItem();
</script>

<script>
	layui.use('table', function() {
		var table = layui.table;

		var laypage = layui.laypage;

		//执行一个laypage实例
		laypage.render({
			elem : 'test1' //注意，这里的 test1 是 ID，不用加 # 号
			,
			count : 50
		//数据总数，从服务端得到
		});

		//第一个实例
		table.render({
			elem : '#demo',
			height : 452,
			url : '../api/itemsmulti?orderid='+localStorage.getItem("orderid") //数据接口
			,
			page : true //开启分页
			,
			cols : [ [ //表头
			{
				field : 'orderid',
				title : '订单编号',
				width : 180,
				sort : true,
				fixed : 'left'
			}, {
				field : 'count',
				title : '订单商品数量',
				width : 180
			}, {
				field : '{{goodsname}}',
				title : '商品名称',
				width : 180,
				sort : true,
				templet : "<div>{{d.goods.goodsname}}</div>"
			},  {
				field : '{{goodsprice}}',
				title : '商品价格',
				width : 180,
				sort : true,
				templet : "<div>{{d.goods.goodsprice}}</div>"
			},
			
			{
				field : 'orderstate',
				title : '订单状态',
				width : 80
			}, {
				field : 'shopname',
				title : '店铺名称',
				width : 80,
				templet : "<div>{{d.shop.shopname}}</div>"
			}, {
				field : 'cost',
				title : '总金额',
				width : 80,
				sort : true
			}, {
				field : '支付宝',
				title : '支付方式',
				width : 80,
				sort : true
			}, {
				field : 'score',
				title : '配送方式',
				width : 80,
				sort : true
			}, {
				field : 'username',
				title : '收货人',
				width : 135,
				sort : true,
				templet : "<div>{{d.user.username}}</div>"
				
			}, {
				field : 'classify',
				title : '操作',
				width : 80,
				templet: '#opTpl'
			} ] ]
		});

	});
</script>

<script>
	

</script>

</html>